#ifndef MESSAGE_HPP
#define MESSAGE_HPP

#include "level.hpp"
#include <string>
#include <vector>
#include <thread>
#include <ctime>

namespace ly
{
    struct LogMessage
    {
        using Level = LogLevel::Level;
        LogMessage() = default;
        // 等级, 行号, 文件名, 信息, 日志器名
        LogMessage(Level level, size_t line, const std::string &file, const std::string &message, const std::string &logger_name)
            : _level(level), _tid(std::this_thread::get_id()), _line(line), _file(file), _message(message), _logger_name(logger_name)
        {
            time_t t = time(0);
            localtime_r(&t, &_time);
        }
        LogLevel::Level _level;
        std::thread::id _tid;
        tm _time;
        size_t _line;
        std::string _file;
        std::string _message;
        std::string _logger_name;
    };
} // namespace ly

#endif // #define MESSAGE_HPP